import 'package:flutter_basic/basic/basic_controller.dart';
import 'package:flutter_basic/multi_engine/snake_channel.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class PropertyListPageController extends BasicController{

  final bool inTheTab;
  PropertyListPageController({this.inTheTab = true});
  RefreshController refreshController = RefreshController(initialRefresh: true);
  RxBool canBack = false.obs;

  RxString info = ''.obs;
  List<String> initialItems = <String>["1", "2", "3", "4", "5", "6", "7", "8"];
  RxList<String> items = <String>[].obs;
  @override
  void onInit() async{
    super.onInit();

    bool isFirst = Get.rawRoute!.isFirst;
    canBack.value = isFirst && !inTheTab;

    if(canBack.value) {
      Map<String, dynamic> result = await SnakeChannel().getInitialRouteInfo();
      String arguments = result['arguments'];
      // argument.value = arguments;
    }
  }

}